<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>闰年</title>
    <script>
        var year= prompt("输入年份");
        console.log(runNian(year));
        function runNian(year){
            var num=0;
            var a=[];
            var j=0;
            for(var i=1;i<=year;i++){
                if((i%4==0)&&(i%100!=0)||(i%400==0)){
                    num++;
                }
                if(i%2==0){
                    a[j]=i;
                    j++;
                }
            }
            return num,a;
        }
    </script>
</head>
<body>
    
</body>
</html>